﻿@model Webcar.Entitys.WORK_MAN

<div style="margin:5px 5px 5px 5px">
@using (Html.BeginForm("Edit", "Account", Html.ViewContext.RouteData.Values,FormMethod.Post))
{
    @Html.AntiForgeryToken()
    <div id="edit-car" style="width:500px">
        <table class="edit-table">
            <tr>
                <td style="width: 80px; text-align: right;">*用户代码：</td>
                <td>
                     @if (Model.OPER_CODE == null)
                     {
                        @Html.TextBoxFor(a => a.OPER_CODE)
                        @Html.Hidden("edit_model","add")
                     }
                     else
                     { 
                         @Html.HiddenFor(a => a.OPER_CODE)
                         @Model.OPER_CODE
                     }

                </td>
                <td style="width: 80px; text-align: right">*用户姓名：</td>
                <td>@Html.TextBoxFor(a => a.OPER_NAME)</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*所属单位：</td>
                <td>@Html.DropDownListFor(a => a.DEPT, WebcarDataHelper.UserSuperDeptList)</td>
                <td style="width: 80px; text-align: right">*是否管理员：</td>
                
                <td>
                    @Html.CheckBoxFor(a => a.IsAdmin)
                </td>
            </tr>
        </table>

        <br />
        <div class="validation-errors">用户默认密码为111</div>
        <div class="validation-errors">@ViewBag.ErrorMessage</div>

    </div>
    <table style="width:500px">
        <tr>
            <td style="width:500px"></td>
            <td>
                @Html.DevExpress().Button(settings =>
        {
            settings.Name = "Button1";
            settings.Text = CurrentUser.CheckPermission(PermissionManager.编辑系统操作员) ? "保存" : "无权限";
            settings.Enabled = CurrentUser.CheckPermission(PermissionManager.编辑系统操作员);
            settings.UseSubmitBehavior = true;
            settings.Width = 70;
            settings.ControlStyle.CssClass = "button1";
        }).GetHtml()
                

            </td>
            <td>
                @Html.DevExpress().Button(settings =>
                {
                    settings.ControlStyle.CssClass = "button2";
                    settings.Name = "Button2";
                    settings.Text = "取消";
                    settings.Width = 70;
                    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("List", "Account") + "' }";
                }).GetHtml()
            </td>
        </tr>

    </table>
}
    </div>

